--受选之人
local shouxuanzhiren = fk.CreateSkill {
    name = "mcdh_shouxuanzhiren",
    tags = {Skill.Compulsory}
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

shouxuanzhiren:addEffect(fk.CardUsing,{
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(self) and target == player and player:getMark("mcdh_shouxuanzhiren-phase") == lib.mcdh_getLoseammo(player) and player.phase == Player.Play
    end,
    can_use = Util.TrueFunc ,
    on_use = function(self, event, target, player, data)
        player:drawCards(1, self.name)
    end,
})

shouxuanzhiren:addEffect(fk.CardUsing,{
    can_refresh = function(self, event, target, player, data)
        return target == player and player:hasSkill("mcdh_shouxuanzhiren") and player.phase == Player.Play
    end,
    on_refresh = function(self, event, target, player, data)
        player.room:addPlayerMark(player, "mcdh_shouxuanzhiren-phase", 1)
    end,
})

Fk:loadTranslationTable {
    ["mcdh_shouxuanzhiren"] = "受选之人",
    [":mcdh_shouxuanzhiren"] = "锁定技，出牌阶段，你使用第X张牌时，你摸一张牌（ X为你的已损失弹药值）。",
}

return shouxuanzhiren